#include "common.hpp"

template<class T>
void writer(T* addr)
{
    SyncLast sync;
    sync.WOpen();

    memset(addr,0,SIZE);
    for(int i='A'; i<='Z'; i++)
    {
        addr[i-'A'] = i;
        sync.Wake();

        sleep(1);        
    }
}

int main()
{

    shm shared_memory;
    shared_memory.get_shm();
    shared_memory.shm_attach();


    writer((char*)shared_memory.get_addr());

    shared_memory.shm_detach();

    return 0;
}